<template>
<Row class="layout-content-body">
    <dtable :columnsList="columns" v-model="dataAll" :totals="total" 
    check  read  
    @get="get" @refresh="getall()" :loading="loading"></dtable>
    <Modal v-model="flag"  title="确认收件"  @on-ok="ansyOk">
        <Form ref="editForm" :model="formItem" :label-width="80" label-position="left">
                <Form-item label="送件人">
                    <Input v-model="formItem.User" placeholder="请输入手机号码"></Input>
                </Form-item>
                <Form-item label="手机号码">
                    <Input v-model="formItem.Phone" placeholder="请输入手机号码"></Input>
                </Form-item>
        </Form>
    </Modal>
</Row>
</template>

<script>
import { timeFormat, currency } from '@/common/filter';
import dtable from '@/components/table/etable.vue'; // 采用biztable
import moment from 'moment'
export default {
    data () {
      return {
        loading: false, // 数据刷新遮罩层
        columns: [
        // 多选框
          {
              title: '案件名称',
              key: 'case_name'
          },
          {
              title: '案件编号',
              key: 'no'
          },
          {
              title: '单位',
              key: 'dept_name'
          },
          {
              title: '取件人',
              key: 'creater'
          },
          {
              title: '取件时间',
              key: 'ctime',
              render: (h, params) => {
              return h('span', {}, moment(params.row.ctime).format('YYYY-MM-DD HH:mm'))
          }
          },
          {
              title: '评分',
              key: 'rate',
              render: (h, {row}) => {
              return h('span', {}, row['rate'] == 0 ? '暂未评分' : row['rate'])
          }
          },
          {
              title: '评价',
              key: 'evaluation'
          },
          {
              title: '备注',
              key: 'remark'
          }
      ], // 表格样式
        dataAll: [], // 表格数据来源
        templist: [],
        dataShow: true, // 是否显示表格数据查看表单
        showTemp: false,
        total: 0,
        orderData: {
          edit: false,
          temp: '',
          type: 2
      },
        jyType: [
          {
              name: '痕迹',
              value: 0,
              children: [
              {
                  name: '手印',
                  value: 0
              },
              {
                  name: '足迹',
                  value: 1
              },
              {
                  name: '工具',
                  value: 2
              },
              {
                  name: '枪弹',
                  value: 3
              },
              {
                  name: '特殊',
                  value: 4
              },
              {
                  name: '爆炸',
                  value: 5
              },
              {
                  name: '其它',
                  value: 6
              }
          ]
          },
          {
              name: '法医',
              value: 1,
              children: [
              {
                  name: '尸体',
                  value: 0
              },
              {
                  name: '活体',
                  value: 1
              },
              {
                  name: '其它',
                  value: 2
              }
          ]
          },
          {
              name: 'DNA',
              value: 2,
              children: [
              {
                  name: '案件检验',
                  value: 0
              },
              {
                  name: '违法犯罪人员血样',
                  value: 1
              },
              {
                  name: '其它',
                  value: 2
              }
          ]
          },
          {
              name: '理化',
              value: 3,
              children: [
              {
                  name: '毒品',
                  value: 0
              },
              {
                  name: '毒物',
                  value: 1
              },
              {
                  name: '微量物证',
                  value: 2
              },
              {
                  name: '酒精含量',
                  value: 3
              },
              {
                  name: '其它',
                  value: 4
              }
          ]
          },
          {
              name: '文检',
              value: 4,
              children: [
              {
                  name: '笔记',
                  value: 0
              },
              {
                  name: '印章',
                  value: 1
              },
              {
                  name: '其他',
                  value: 2
              }
          ]
          },
          {
              name: '电子物证',
              value: 5,
              children: [
              {
                  name: '手机',
                  value: 0
              },
              {
                  name: '电脑',
                  value: 1
              },
              {
                  name: '存储设备',
                  value: 2
              },
              {
                  name: '其它',
                  value: 3
              }
          ]
          }
      ],
        jyCategory: [],
        flag: false,
        formItem: {
          Id: '',
          User: '',
          Phone: ''
      }
    }
  },
    components: {
      dtable
  },
    computed: {},
    watch: {},
    methods: {
      ansyOk () {
        console.log(this.formItem)
        this.$api.UpdateTodoStatus(this.formItem).then(res => {
            if (res.code == 0) {
                console.log('success')
                this.getall()
            }
        })
    },
      next () {
        this.flag = true
    },
      getall () {
        this.loading = true
      let data = {
          busyName: 'sf_case'
      }
      this.$api.GetYiQuJian(data).then(res => {
          console.debug(res.Data)
        if (!res.error) {
            this.dataAll = res.Data
          if (this.dataAll) {
              this.total = this.dataAll.length
          }
        } else {
            this.$Message.error(res.message)
        }
      })
      this.loading = false
    },

      get (data) {
        console.log(data)
        this.orderData.order = data
      this.orderData.edit = false
      this.$router.push({
          name: '司法检验审核',
          params: {
            orderData: this.orderData
        }
      })
    }
  },
    mounted () {
    // this.getall();
  }
}
</script>
